package com.leoman.dao;

import com.leoman.entity.Post;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 帖子
 * Created by Administrator on 2016/10/18 0018 下午 3:03.
 */
public interface PostDao extends JpaRepository<Post, Integer>, JpaSpecificationExecutor<Post> {

    @Query("select a from Post a where a.createTime >= ?1")
    List<Post> findListByCreateTime(Long createTime);

    @Query("select a from Post a where a.checkStatus = ?1")
    List<Post> findListByCheckStatus(Integer checkStatus);
}